#coding:utf8
d = {}
d['shisongyan'] = (1, 18)
d['cailele'] = (2, 19)
d['shilei'] = (3, 20)
d['caixiaojie'] = (4, 21)
#字典默认是无序的
print(d)


from collections import OrderedDict
d = OrderedDict()
d['shisongyan'] = (1, 18)
d['cailele'] = (2, 19)
d['shilei'] = (3, 20)
d['caixiaojie'] = (4, 21)
print(d)


#模拟一个答题记录成绩的系统
from time import time
from random import randint

name = ['shisongyan', 'cailele', 'lizhengyong', 'wanghaiyu', 'lishu']
start = time()
grade = OrderedDict()
length = len(name)
for i in range(length):
    raw_input('请开始你的故事 ')
    player = name.pop(randint(0, len(name)-1))
    end = time()
    grade[player] = (i+1, end - start)
    print(i+1, player, end - start)

print(grade)